package com.kehutong.wxapi.service;

import com.kehutong.wxapi.request.*;
import com.kehutong.wxapi.response.*;
import com.kehutong.wxapi.service.impl.UserServiceImpl;
import org.coraframework.inject.ImplementedBy;

/**
 * 成员管理服务类
 */
@ImplementedBy(UserServiceImpl.class)
public interface UserService {

    /**
     * 创建成员
     * 请求地址：https://qyapi.weixin.qq.com/cgi-bin/user/create?access_token=ACCESS_TOKEN
     * @param userCreateRequest 创建成员请求对象
     * @return 创建成员响应对象
     * @throws Exception 异常
     */
    UserCreateResponse userCreate(UserCreateRequest userCreateRequest) throws Exception;


    /**
     * 读取成员
     * 请求地址：https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&userid=USERID
     * @param userGetRequest 读取成员请求对象
     * @return 读取成员响应对象
     * @throws Exception 异常
     */
    UserGetResponse userGet(UserGetRequest userGetRequest) throws Exception;


    /**
     * 更新成员
     * 请求地址：https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token=ACCESS_TOKEN
     * @param userUpdateRequest 更新成员请求对象
     * @return 更新成员响应对象
     * @throws Exception 异常
     */
    UserUpdateResponse userUpdate(UserUpdateRequest userUpdateRequest) throws Exception;

    /**
     * 删除成员
     * 请求地址：https://qyapi.weixin.qq.com/cgi-bin/user/delete?access_token=ACCESS_TOKEN&userid=USERID
     * @param userDeleteRequest 删除成员请求对象
     * @return 删除成员响应对象
     * @throws Exception 异常
     */
    UserDeleteResponse UserDelete(UserUpdateRequest userDeleteRequest) throws Exception;


    /**
     * 批量删除成员
     * 请求地址：https://qyapi.weixin.qq.com/cgi-bin/user/batchdelete?access_token=ACCESS_TOKEN
     * @param userBatchDeleteRequest 批量删除成员请求对象
     * @return 批量删除成员响应对象
     * @throws Exception 异常
     */
    UserBatchDeleteResponse userBatchDelete(UserBatchDeleteRequest userBatchDeleteRequest) throws Exception;


    /**
     * 获取部门成员
     * 请求地址：https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID&fetch_child=FETCH_CHILD
     * @param userSimpleListRequest 获取部门成员请求对象
     * @return 获取部门成员响应对象
     * @throws Exception 异常
     */
    UserSimpleListResponse userSimpleList(UserSimpleListRequest userSimpleListRequest) throws Exception;


    /**
     * 获取部门成员详情
     * 请求地址：https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID&fetch_child=FETCH_CHILD
     * @param userListRequest 获取部门成员详情请求对象
     * @return 获取部门成员详情响应对象
     * @throws Exception 异常
     */
    UserListResponse userList(UserListRequest userListRequest) throws Exception;


    /**
     * userid与openid互换
     * 请求地址： https://qyapi.weixin.qq.com/cgi-bin/user/convert_to_openid?access_token=ACCESS_TOKEN
     * @param userConvertToOpenidRequest userid与openid互换请求对象
     * @return userid与openid互换响应对象
     * @throws Exception 异常
     */
    UserConvertToOpenidResponse userConvertToOpenid(UserConvertToOpenidRequest userConvertToOpenidRequest) throws Exception;

}
